<%@page language="java" contentType="text/html; charset=UTF-8" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="html" tagdir="/WEB-INF/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<!DOCTYPE html>
<html>
<html:header title="付款单详情">

    <link rel="stylesheet" href="${baseUrl}css/public.css" media="all">

    <style type="text/css">
        label{
            display:-moz-inline-box;
            display:inline-block;
            width:80px;
            color: #aaaaaa;
        }

        .label{
            display:-moz-inline-box;
            display:inline-block;
            width:80px;
            color: #aaaaaa;
            float: left;
        }


        .info{
            padding: 2px;
            overflow: hidden;
        }

        .bottom-info{
            color:#aaaaaa; font-size: 10px;padding-right: 10px;
        }
    </style>

    <script>
        jQuery(function () {
            $("#cancel").click(function () {
                closeSubIframe();
            });

            get("${baseUrl}funds/payOrder/getVoById.action?id=${id}", function (res) {
                if (res.code == 1) {
                    let data = res.data;
                    $("#print").click(function () {
                        document.getElementById("printFrame").contentWindow.printPage(res.data);
                    });
                    if (res.data.close) {
                        showCloseImage();
                    }

                    $("#no").html(data.no);
                    $("#store").html(data.store.name);
                    $("#provider").html(data.provider.name);
                    $("#date").html(GMTToDate(data.date));
                    $("#settAccount").html(data.settAccountVo.store.name + " > " + data.settAccountVo.name);

                    $("#waitPay").html(getPrice(data.waitPay));
                    $("#thisPay").html(getPrice(data.thisPay));
                    $("#discount").html(getPrice(data.discount));
                    $("#total").html(getPrice(data.total));
                    $("#remark").html(data.remark);


                    $("#user").html(data.user.name);
                    $("#make-time").html(data.makeTime);
                    $("#maker").html(data.makeUser.name);

                    parseImageNames(data.image);

                } else {
                    errTip(res.msg);
                }
            });
        });
    </script>

</html:header>
<iframe id="printFrame" style="width:0px;height:0px" src="${baseUrl}print/payOrderPrint.action" frameborder="0"></iframe>
<body>
<div style="margin-bottom: 20px;">
    <div class="layui-inline">
        <a class="layui-btn" id="print">打印</a>
    </div>
    <div class="layui-inline">
        <a class="layui-btn layui-btn-primary" id="cancel">取消</a>
    </div>
</div>

<div class="layuimini-container">
    <div class="layuimini-main">
        <html:closeOrderImage/>

        <h2 class="tableBeforeTitle">付款单</h2>
        <div style="height: 4px;background-color: #bbbbbb;width: 100%;margin: 20px 0 2px 0;"></div>
        <div style="height: 1px;width: 100%;background-color: #dddddd;margin-bottom: 10px;"></div>
        <div style="height: 10px;"></div>
        <div style="height: 20px;"></div>

        <hr>
        <div class="info"><label>单据编号:</label><span id="no"></span></div>
        <div class="info"><label>门店:</label><span id="store"></span></div>
        <div class="info"><label>供应商:</label><span id="provider"></span></div>
        <div class="info"><label>付款日期:</label><span id="date"></span></div>
        <div class="info"><label>结算账户:</label><span id="settAccount"></span></div>
        <div class="info"><label>应付金额:</label><span id="waitPay"></span></div>
        <div class="info"><label>本次付款:</label><span id="thisPay"></span></div>
        <div class="info"><label>优惠:</label><span id="discount"></span></div>
        <div class="info"><label>合计:</label><span id="total"></span></div>
        <div class="info"><label>备注:</label><span id="remark"></span></div>
        <div class="info">
            <div class="label">附件图片:</div>
            <html:imageAnnex type="payOrder" update="true"
                             uploadUrl="${baseUrl}funds/payOrder/uploadImg.action"
                             updateUrl="${baseUrl}funds/payOrder/updateImage.action"/>
        </div>


        <hr>
        <span class="bottom-info">经办人:<span id="user"></span></span>
        <span class="bottom-info">制单人:<span id="maker"></span></span>
        <span class="bottom-info">制单时间:<span id="make-time"></span></span>
    </div>
</div>

</body>
<html:loading/>
</html>